//package redis;
//
//import java.io.BufferedWriter;
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.FileNotFoundException;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.io.UnsupportedEncodingException;
//import org.json.JSONArray;
//import org.json.JSONException;
//import org.json.JSONObject;
//
//public class RecipeWitten {
//	public static void main(String[] args) {
//		File file=new File("C:\\Users\\ahui\\Desktop\\中晚餐.done.txt");
//        Long filelength = file.length();
//        byte[] filecontent = new byte[filelength.intValue()];
//        try {
//            FileInputStream in = new FileInputStream(file);
//            in.read(filecontent);
//            in.close();
//        } catch (FileNotFoundException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        
//		try {
//			BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\Users\\ahui\\Desktop\\aaaa.sql",true));
//			String content = new String(filecontent,"UTF-8");
//			content = content.replaceAll("\\s*", "");
//			JSONObject object;
//			StringBuilder insertSql = new StringBuilder();
//			JSONArray test = new JSONArray(content);
//			for (int i = 0; i < test.length(); i++) {
//				object = test.getJSONObject(i);
//				
//				insertSql.append("insert into recipes ")
//				.append("(id,title,foods,rate,technology,region_taste,img,type) values (")
//				.append("'"+object.getString("id")+"',")
//				.append("'"+object.getString("title")+"',")
//				.append("'"+object.getString("foods")+"',")
//				.append("'"+object.getString("rate")+"',")
//				.append("'"+object.getString("technology")+"',")
//				.append("'"+object.getString("region_taste")+"',")
//				.append("'"+object.getString("img")+"',")
//				.append("'"+object.getString("type")+"'")
//				.append(");\r\n");
//				
//			}
//			bw.write(insertSql.toString());
//			bw.close();
//		} catch (UnsupportedEncodingException e1) {
//			e1.printStackTrace();
//		} catch (JSONException e) {
//			e.printStackTrace();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//	}
//}
